Repository navigation
Artifacts/build 3.0.0 - #11
Esmail-sarhadi wants to merge 15 commits into
Conversation
…build verification
Adds a landing Overview view (health ring, KPIs, quick actions, doctor checklist, reports, endpoints, safe-mode banner), polishes the design system (gradient hero, tinted chrome, button busy/focus states, new login overlay), and keeps all five themes consistent. Installed copies now keep data in LOCALAPPDATA via installed.flag. Fixes a startup crash where bracketed IPv6 entries in NO_PROXY made httpx raise InvalidURL. Adds meaningful tests for NO_PROXY normalisation, installed.flag pathing and the login copy.
Adds a real Windows Setup.exe (Inno Setup 7): admin install with a per-user option, app mutex integration, Start Menu/desktop shortcuts, optional autostart, branded wizard bitmaps generated from the dashboard palette, and an installed.flag so user data stays in LOCALAPPDATA across upgrades and uninstalls. Includes a one-command build pipeline that reads the package version and compiles the setup, plus README and PR proposal updates. Silent install, launch and clean uninstall were verified end to end.
mount() is synchronous, so awaiting refresh() was a syntax error that blanked the whole page. Import every view module in a browser test to catch this class of bug, and mount the doctor view against fixtures.
Config Doctor and the captcha sidecar spawned console programs from a windowed exe, so each Overview poll flashed cmd windows. Hide the children and reuse the last doctor snapshot between polls; refetch only on Run health check, repair, or a fresh mount.
There was a problem hiding this comment.
60 issues found across 42 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/install/windows_install.py">
<violation number="1" location="scripts/install/windows_install.py:92">
P1: Portable mode copies the executable to `target/app` but skips `DATA_ITEMS`, so existing portable config, accounts, and database files stay beside the source executable while the new launcher starts with empty data. Migrate these items to `exe_copy.parent` in portable mode instead of skipping the loop.</violation>
<violation number="2" location="scripts/install/windows_install.py:96">
P1: Migration raw-copies `gateway.db`, `gateway.db-shm`, and `gateway.db-wal` independently without ensuring the source gateway is stopped. Because the gateway uses WAL, a live copy can combine different snapshots or miss committed rows; require an exclusive stop/lock or use SQLite's backup/checkpoint mechanism.</violation>
<violation number="3" location="scripts/install/windows_install.py:103">
P2: Both generated launchers write absolute `LOCALAPPDATA` and target paths using ASCII, so a normal Windows profile or custom target containing non-ASCII characters fails before the launcher is created. Use a cmd-compatible Unicode encoding or generate the launcher with `%~dp0`-relative paths instead of serializing arbitrary absolute paths.</violation>
<violation number="4" location="scripts/install/windows_install.py:113">
P2: In portable mode `data` remains `<target>/data`, but the launcher omits `ZGW_DATA_DIR` and the copied executable writes beside itself in `<target>/app`; this README names a directory the gateway does not use. Report `exe_copy.parent` for portable mode and avoid creating the unused data directory.</violation>
</file>
<file name="zcode_gateway/run_report.py">
<violation number="1" location="zcode_gateway/run_report.py:34">
P1: `redact()` still emits several standard credential formats unchanged, so a worker log or diagnostic detail containing `access_token`, `refresh_token`, `api_key`, or single-quoted JSON can leak into a supposedly safe report. Extend the credential-pattern coverage before rendering.</violation>
<violation number="2" location="zcode_gateway/run_report.py:175">
P1: Explicit run reports cannot find their production worker logs because filenames contain a random worker ID, not the Auto Generate run ID. Store the run association in the log filename or metadata, then select logs using that association.</violation>
<violation number="3" location="zcode_gateway/run_report.py:182">
P2: The progress writer stores `attempts`, `qualified`, and `failed` at the top level, not under `counts`, so current reports show zero attempts and failures. Read the top-level counters when constructing `counts`.</violation>
<violation number="4" location="zcode_gateway/run_report.py:186">
P2: The log-only fallback never derives `attempts` or `failed`, so standalone reports show zero attempts and failures despite having worker logs. Populate those summary counters from `workers` in the fallback.</violation>
<violation number="5" location="zcode_gateway/run_report.py:194">
P2: The timeline is always empty for current runs because persistence removes `events` before writing the progress file. Persist the event history or pass it to report generation from the live status source.</violation>
</file>
<file name="scripts/installer/build_installer.ps1">
<violation number="1" location="scripts/installer/build_installer.ps1:34">
P1: `-SkipAppBuild` can package a stale executable after a version change because this guard checks existence only. Validate the executable’s `FileVersion`/`ProductVersion` against `${version}.0` before compiling, or rebuild when they differ.</violation>
<violation number="2" location="scripts/installer/build_installer.ps1:45">
P2: This selection reverses the documented PATH-before-default precedence. On machines with multiple ISCC versions, the default installation silently overrides the compiler selected on PATH; query PATH before the default candidates.</violation>
<violation number="3" location="scripts/installer/build_installer.ps1:57">
P1: This call requires Pillow, but the documented Windows and development requirements do not install it. A fresh build therefore aborts before producing Setup.exe; add Pillow to the build dependencies or provision it before generating the bitmaps.</violation>
</file>
<file name="zcode_gateway/paths.py">
<violation number="1" location="zcode_gateway/paths.py:44">
P1: This installed-mode branch can still send account reads and writes to `<exe>/accounts` when that folder contains snapshots, defeating the promise that installed data stays outside Program Files. Restrict account discovery to `base/accounts` for installed/override data directories, or explicitly migrate the legacy folder before selecting it.</violation>
</file>
<file name="zcode_gateway/auto_generate.py">
<violation number="1" location="zcode_gateway/auto_generate.py:180">
P2: Scheduler failures bypass this finish callback: `_run` sets `scheduler_error` and exits without notifying the owner. Call the callback from that terminal exception path too, so failures after a registration still trigger the required post-run processing.</violation>
<violation number="2" location="zcode_gateway/auto_generate.py:714">
P1: This notification has a run-identity race: a concurrent `start()` can replace `_run_id` after the old run finishes but before `_notify_finish()` reads it, so the old callback receives the new run's status and marks the new run as already notified. Capture the completed run's callback, ID, and status while holding the lock, then invoke that captured callback outside the lock.</violation>
</file>
<file name="zcode_gateway/api_dash.py">
<violation number="1" location="zcode_gateway/api_dash.py:1709">
P1: The fallback path does not match the manager's data directory for an external generator checkout. Resolve the configured generator directory and apply `_generator_data_dir()` before falling back, otherwise the start guard can bypass a recorded rate limit and the dashboard reads/writes the wrong reports.</violation>
<violation number="2" location="zcode_gateway/api_dash.py:1717">
P2: The rate-limit refresh rereads all worker logs on the event loop, so a large log directory can stall unrelated gateway requests. Run `scan` in `asyncio.to_thread` in these handlers, as the existing generator status endpoint does for blocking disk work.</violation>
<violation number="3" location="zcode_gateway/api_dash.py:1845">
P1: These endpoints ignore the configured account directory and source. Use `state.cfg.accounts.dir` consistently, and reject folder import when the account source is not `accounts_dir`; otherwise custom installs report successful imports that never enter the pool.</violation>
</file>
<file name="zcode_gateway/rate_limit.py">
<violation number="1" location="zcode_gateway/rate_limit.py:72">
P1: `scan()` deletes the persisted rate-limit state whenever no matching log is available, so log cleanup or temporary log unavailability can bypass an otherwise active Safe Mode lock. Preserve an active `rate_limit.json` until its `unlock_at` has expired, rather than using log presence as the source of truth.</violation>
<violation number="2" location="zcode_gateway/rate_limit.py:115">
P2: A syntactically valid but malformed `rate_limit.json` makes `status` raise `ValueError`, so the start guard returns 500 instead of handling the state safely. Validate `unlock_at` before arithmetic and treat invalid values consistently.</violation>
<violation number="3" location="zcode_gateway/rate_limit.py:145">
P1: `guard` ignores a newly written rate-limit log until another endpoint happens to call `scan`, so a direct or immediate start can launch attempts during the provider lock. Scan the logs before evaluating the guard.</violation>
</file>
<file name="scripts/installer/zcode-gateway.iss">
<violation number="1" location="scripts/installer/zcode-gateway.iss:76">
P1: Installing this marker switches the app to LOCALAPPDATA, but Setup never migrates an existing portable data folder, so upgrades start without the user’s config and accounts. Add migration before enabling the marker.</violation>
<violation number="2" location="scripts/installer/zcode-gateway.iss:83">
P2: The autostart option is machine-wide for the default admin install, so every Windows user starts a gateway at sign-in and multiple sessions can contend for the same port. Write this entry to the installing user’s `HKCU` instead.</violation>
</file>
<file name="zcode_gateway/dashboard/assets/js/views/auto-generate.js">
<violation number="1" location="zcode_gateway/dashboard/assets/js/views/auto-generate.js:424">
P2: The log filter drops or miscolors events whose text does not match the heuristic, despite the backend supplying explicit `warn` and `error` levels. Use the event level (`error` → `err`, `warn` → `warn`) for both the CSS class and `data-tone`, falling back to `logTone` for other levels.</violation>
<violation number="2" location="zcode_gateway/dashboard/assets/js/views/auto-generate.js:492">
P2: Safe Mode countdowns use seconds against `Date.now()` milliseconds, so every active rate limit appears expired and the UI re-enables Start/Resume. Convert `unlock_at` to milliseconds or compare it with `Date.now() / 1000`, including the displayed date.</violation>
<violation number="3" location="zcode_gateway/dashboard/assets/js/views/auto-generate.js:506">
P2: The Auto Generate view ignores `rateLock.enabled`, so turning Safe Mode off still disables Start and Resume until the provider lock expires, even though the server permits those actions. Normalize `active` with `enabled !== false` before rendering the controls.</violation>
</file>
<file name="README.md">
<violation number="1" location="README.md:46">
P2: The README advertises a Setup executable that the canonical release workflow never builds or uploads, so users following this path cannot install it from Releases. Publish the installer in the release pipeline before documenting it, or keep the portable download as the supported Windows path.</violation>
</file>
<file name="zcode_gateway/dashboard/assets/js/core/report.js">
<violation number="1" location="zcode_gateway/dashboard/assets/js/core/report.js:17">
P2: The fallback `window.open` runs only after two awaited requests, so browsers treat it as a non-user-initiated popup and may block it—the exact popup-blocker failure the previous implementation avoided. Reserve a tab synchronously in the original click handler before any awaits, then navigate it after obtaining the short-lived link and close it when the external-browser open succeeds.</violation>
</file>
<file name="zcode_gateway/dashboard/assets/js/core/logs.js">
<violation number="1" location="zcode_gateway/dashboard/assets/js/core/logs.js:6">
P2: `qualified` is treated as a success signal anywhere in the line, including the qualified counter on failed-attempt summaries. Match the qualified outcome (for example, `finished: qualified`) rather than the counter, otherwise failed and no-plan attempts render green.</violation>
<violation number="2" location="zcode_gateway/dashboard/assets/js/core/logs.js:8">
P2: The warning pattern does not recognize the normal `failed` and `failure` wording emitted by session and worker events. Add word-bounded `failed`/`failure` alternatives so these failures are not shown as informational or uncolored lines.</violation>
<violation number="3" location="zcode_gateway/dashboard/assets/js/core/logs.js:15">
P2: The explicit `extra` class is appended before the inferred tone, allowing an inferred `info`, `warn`, or `ok` class to override an explicit error class in the stylesheet. Append `extra` after the inferred class so event severity remains authoritative.</violation>
</file>
<file name="tests/test_dashboard_review_fixes.py">
<violation number="1" location="tests/test_dashboard_review_fixes.py:45">
P2: The doctor fixture does not mock `/admin/dash/safe-mode`, so mounting the doctor records an unexpected aborted request and fails in fixture teardown. Add a safe-mode default response.</violation>
<violation number="2" location="tests/test_dashboard_review_fixes.py:110">
P2: This test does not parse every view module because `glob("*.js")` excludes nested `generator/` and `proxy/` views. Enumerate recursively and build each module’s relative slash-separated import path.</violation>
</file>
<file name="PR_PROPOSAL.md">
<violation number="1" location="PR_PROPOSAL.md:43">
P2: `windows_install.py` does not create the desktop or Start Menu shortcuts claimed here; it only writes a `.cmd` launcher and README. Add shortcut creation to that script or remove this claim from the proposal.</violation>
<violation number="2" location="PR_PROPOSAL.md:44">
P2: This migration is not confirmation-based: `windows_install.py` silently copies only missing items from the executable’s parent and skips any existing destination. Implement explicit detection and confirmation before copying, or correct the proposal’s migration guarantee.</violation>
<violation number="3" location="PR_PROPOSAL.md:83">
P2: The Doctor repair button cannot perform the repairs listed here. Its endpoint handles only generator location, domain rotation, and pool reload, so package, Chromium, and inbox failures remain manual despite being presented as automatically repairable.</violation>
</file>
<file name="zcode_gateway/dashboard/assets/js/views/overview.js">
<violation number="1" location="zcode_gateway/dashboard/assets/js/views/overview.js:42">
P2: Overview bypasses the shared WebView-safe report opener and opens an authenticated report as a `blob:` URL. Report buttons therefore fail in the packaged WebView; import and use `core/report.js`'s `openReport` helper.</violation>
<violation number="2" location="zcode_gateway/dashboard/assets/js/views/overview.js:215">
P2: `load` waits for every endpoint before painting any panel. A slow Zcode-status or doctor request leaves healthy cards on skeletons; paint each endpoint independently or bound the wait.</violation>
<violation number="3" location="zcode_gateway/dashboard/assets/js/views/overview.js:342">
P2: The overview offers Fix for non-fixable checks, then reports a misleading successful repair attempt even though the repair endpoint ignores those check names. Render this button only when `value.fixable` is true.</violation>
<violation number="4" location="zcode_gateway/dashboard/assets/js/views/overview.js:397">
P2: The Overview copies non-dialable client URLs when the gateway binds to `0.0.0.0` or `::`, and uses HTTP on an HTTPS dashboard. Reuse the Server view's client-base logic for these links.</violation>
<violation number="5" location="zcode_gateway/dashboard/assets/js/views/overview.js:426">
P2: Manual health checks always hit a `ReferenceError` after `load()` succeeds because `doctor` is local to `load`; use `lastDoctor` when calculating the toast.</violation>
</file>
<file name="zcode_gateway/config_doctor.py">
<violation number="1" location="zcode_gateway/config_doctor.py:96">
P2: This check accepts unsupported Python versions as healthy. Require a parsed version of at least 3.10 before returning `ok`, otherwise generation can proceed with an incompatible interpreter.</violation>
<violation number="2" location="zcode_gateway/config_doctor.py:178">
P2: `check_cloudflare()` never reliably selects the configured domain: it indexes the stringified list and otherwise probes an arbitrary first zone. Extract the first domain before stringifying and query that zone explicitly.</violation>
<violation number="3" location="zcode_gateway/config_doctor.py:205">
P2: Routing probe failures are silently treated as success. Append a routing failure whenever this response is not a valid successful result, otherwise missing Email Routing permissions appear healthy.</violation>
<violation number="4" location="zcode_gateway/config_doctor.py:300">
P2: The Wrangler check receives the generator data directory instead of the exported worker directory, so it reports only whether the always-present data directory exists. Pass the manager’s resolved worker directory to detect missing worker files.</violation>
</file>
<file name="zcode_gateway/dashboard/assets/js/views/doctor.js">
<violation number="1" location="zcode_gateway/dashboard/assets/js/views/doctor.js:107">
P2: This condition exposes Repair for checks that `/admin/dash/doctor/repair` cannot repair, so clicking Repair on packages or Chromium does nothing while claiming it was attempted. Restrict the button to the checks supported by the repair endpoint, or add matching backend actions.</violation>
<violation number="2" location="zcode_gateway/dashboard/assets/js/views/doctor.js:127">
P2: A failed Safe Mode status request currently renders the default “On — no active rate limit” state. Show an unavailable/error state and return from `loadSafeMode` instead of displaying an affirmative safety status when the endpoint did not respond.</violation>
</file>
<file name="zcode_gateway/dashboard/assets/css/tokens.css">
<violation number="1" location="zcode_gateway/dashboard/assets/css/tokens.css:314">
P2: The new brand gradient makes primary-button labels fail normal-text contrast in the light, sepia, and Nord themes, especially at the Nord second stop. Darken these gradient stops or choose a foreground that maintains at least 4.5:1 contrast across the entire gradient.</violation>
</file>
<file name="WORKBUDDY_MEMORY.md">
<violation number="1" location="WORKBUDDY_MEMORY.md:227">
P2: This committed memory file exposes a personal account identifier and live pool/infrastructure details. Remove or redact personal, account, and deployment data from the repository; keep the work log outside the tracked project.</violation>
<violation number="2" location="WORKBUDDY_MEMORY.md:259">
P2: These are truncated prefixes, not verifiable SHA-256 digests, so `certutil` cannot confirm either download from this line. Publish the complete 64-character hashes or remove the verification claim.</violation>
</file>
<file name="tests/test_workbuddy_additions.py">
<violation number="1" location="tests/test_workbuddy_additions.py:39">
P2: These redaction tests do not verify that the original credential is absent, so they can pass while reports still leak secrets. Assert each fixture’s original secret is not in the redacted result, as the JWT and query-key tests already do.</violation>
<violation number="2" location="tests/test_workbuddy_additions.py:638">
P2: This test does not verify that the report link is short-lived; it only checks that its absolute expiry is positive. Assert that `entry[1] - time.time()` is positive and no greater than `api_dash._REPORT_LINK_TTL`.</violation>
</file>
<file name="scripts/installer/make_wizard_images.py">
<violation number="1" location="scripts/installer/make_wizard_images.py:79">
P2: `_logo` is downsampled before it is composited onto the 4x canvases, so both installer logos render roughly four times smaller than their requested sizes. Return the supersampled image here and only downsample the complete canvas at the end.</violation>
<violation number="2" location="scripts/installer/make_wizard_images.py:121">
P2: These glow centers use logical pixels on a 4x canvas, shifting both glows toward the upper-left instead of placing them at their intended locations. Scale each center coordinate by `S` before passing it to `_glow`.</violation>
</file>
<file name="zcode_gateway/dashboard/assets/css/components.css">
<violation number="1" location="zcode_gateway/dashboard/assets/css/components.css:158">
P2: This busy state does not prevent keyboard activation. The per-check Fix button remains focused and can be activated repeatedly while `repairOne` is awaiting its request, causing duplicate repair calls; disable the button or add an in-flight guard when setting `aria-busy`.</violation>
</file>
<file name="scripts/report/generate_html.py">
<violation number="1" location="scripts/report/generate_html.py:41">
P2: This command reports success for a nonexistent or mistyped `--data-dir`, creating a new directory and an empty `run_latest.html` instead of indicating that the input folder is wrong. Validate that the data directory exists before calling `generate()` so automation and users do not mistake an empty report for a real run.</violation>
</file>
<file name="zcode_gateway/process_env.py">
<violation number="1" location="zcode_gateway/process_env.py:20">
P2: This transformation corrupts valid port-qualified IPv6 entries: `[2001:db8::1]:8080` becomes `2001:db8::1:8080`, so httpx cannot reliably recognize port 8080 and may proxy requests that should bypass it. Normalize entries structurally instead of deleting brackets globally, preserving or explicitly handling the port.</violation>
</file>
<file name="zcode_gateway/dashboard/assets/js/boot.js">
<violation number="1" location="zcode_gateway/dashboard/assets/js/boot.js:184">
P2: Re-authentication does not reset the reveal state, so a key revealed once remains a plaintext input when `showLogin` is displayed after an auth rejection. Reset the input to `password` and restore the reveal button state whenever the login gate opens.</violation>
</file>
<file name="zcode_gateway/dashboard/assets/js/views/generator/mail.js">
<violation number="1" location="zcode_gateway/dashboard/assets/js/views/generator/mail.js:96">
P2: The new “Use first” action does not affect domain selection in the bundled worker: rotate mode still chooses randomly from `ZAI_MAIL_DOMAINS`. Either implement ordered/preferred selection in the worker or remove this control and its “starts the rotation” claim.</violation>
</file>
<file name="zcode_gateway/dashboard/assets/js/views/accounts.js">
<violation number="1" location="zcode_gateway/dashboard/assets/js/views/accounts.js:443">
P2: This button is enabled on Linux whenever the folder exists, but `/admin/dash/accounts-folder/open` always returns 400 there. Gate it using a server-reported `open_folder` capability (or an `open_supported` response field) so unsupported hosts do not offer a guaranteed-failing action.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
| if not portable: | ||
| for name in DATA_ITEMS: | ||
| source = exe.parent / name | ||
| destination = data / name | ||
| if copy_if_missing_source(source, destination, dry_run): | ||
| migrated.append(name) |
There was a problem hiding this comment.
P1: Portable mode copies the executable to target/app but skips DATA_ITEMS, so existing portable config, accounts, and database files stay beside the source executable while the new launcher starts with empty data. Migrate these items to exe_copy.parent in portable mode instead of skipping the loop.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At scripts/install/windows_install.py, line 92:
<comment>Portable mode copies the executable to `target/app` but skips `DATA_ITEMS`, so existing portable config, accounts, and database files stay beside the source executable while the new launcher starts with empty data. Migrate these items to `exe_copy.parent` in portable mode instead of skipping the loop.</comment>
<file context>
@@ -0,0 +1,142 @@
+ shutil.copy2(exe, exe_copy)
+
+ migrated = []
+ if not portable:
+ for name in DATA_ITEMS:
+ source = exe.parent / name
</file context>
| if not portable: | |
| for name in DATA_ITEMS: | |
| source = exe.parent / name | |
| destination = data / name | |
| if copy_if_missing_source(source, destination, dry_run): | |
| migrated.append(name) | |
| data_destination = data if not portable else exe_copy.parent | |
| for name in DATA_ITEMS: | |
| source = exe.parent / name | |
| destination = data_destination / name | |
| if copy_if_missing_source(source, destination, dry_run): | |
| migrated.append(name) |
| out_dir.mkdir(parents=True, exist_ok=True) | ||
|
|
||
| logs_dir = data_dir / "logs" / "workers" | ||
| pattern = f"auto-{run_id}*.log" if run_id else "auto-*.log" |
There was a problem hiding this comment.
P1: Explicit run reports cannot find their production worker logs because filenames contain a random worker ID, not the Auto Generate run ID. Store the run association in the log filename or metadata, then select logs using that association.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At zcode_gateway/run_report.py, line 175:
<comment>Explicit run reports cannot find their production worker logs because filenames contain a random worker ID, not the Auto Generate run ID. Store the run association in the log filename or metadata, then select logs using that association.</comment>
<file context>
@@ -0,0 +1,214 @@
+ out_dir.mkdir(parents=True, exist_ok=True)
+
+ logs_dir = data_dir / "logs" / "workers"
+ pattern = f"auto-{run_id}*.log" if run_id else "auto-*.log"
+ logs = sorted(logs_dir.glob(pattern)) if logs_dir.is_dir() else []
+ workers = [parse_worker_log(p) for p in logs]
</file context>
| Write-Host " iscc : $iscc" | ||
|
|
||
| Write-Host " wizard : regenerating brand bitmaps" -ForegroundColor DarkGray | ||
| & $py (Join-Path $Here "scripts\installer\make_wizard_images.py") --version $version |
There was a problem hiding this comment.
P1: This call requires Pillow, but the documented Windows and development requirements do not install it. A fresh build therefore aborts before producing Setup.exe; add Pillow to the build dependencies or provision it before generating the bitmaps.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At scripts/installer/build_installer.ps1, line 57:
<comment>This call requires Pillow, but the documented Windows and development requirements do not install it. A fresh build therefore aborts before producing Setup.exe; add Pillow to the build dependencies or provision it before generating the bitmaps.</comment>
<file context>
@@ -0,0 +1,72 @@
+Write-Host " iscc : $iscc"
+
+Write-Host " wizard : regenerating brand bitmaps" -ForegroundColor DarkGray
+& $py (Join-Path $Here "scripts\installer\make_wizard_images.py") --version $version
+if ($LASTEXITCODE -ne 0) { throw "Wizard bitmap generation failed" }
+
</file context>
| if (base / "installed.flag").is_file(): | ||
| fallback = _per_user_dir() | ||
| fallback.mkdir(mode=0o700, parents=True, exist_ok=True) | ||
| return fallback |
There was a problem hiding this comment.
P1: This installed-mode branch can still send account reads and writes to <exe>/accounts when that folder contains snapshots, defeating the promise that installed data stays outside Program Files. Restrict account discovery to base/accounts for installed/override data directories, or explicitly migrate the legacy folder before selecting it.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At zcode_gateway/paths.py, line 44:
<comment>This installed-mode branch can still send account reads and writes to `<exe>/accounts` when that folder contains snapshots, defeating the promise that installed data stays outside Program Files. Restrict account discovery to `base/accounts` for installed/override data directories, or explicitly migrate the legacy folder before selecting it.</comment>
<file context>
@@ -24,12 +24,24 @@ def app_dir() -> Path:
+ if (base / "installed.flag").is_file():
+ fallback = _per_user_dir()
+ fallback.mkdir(mode=0o700, parents=True, exist_ok=True)
+ return fallback
if not getattr(sys, "frozen", False) and (base / ".git").is_dir():
base = base / ".local" / "runtime"
</file context>
| self._thread = None | ||
| self._stop_handles(handles) | ||
| if finished: | ||
| self._notify_finish() |
There was a problem hiding this comment.
P1: This notification has a run-identity race: a concurrent start() can replace _run_id after the old run finishes but before _notify_finish() reads it, so the old callback receives the new run's status and marks the new run as already notified. Capture the completed run's callback, ID, and status while holding the lock, then invoke that captured callback outside the lock.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At zcode_gateway/auto_generate.py, line 714:
<comment>This notification has a run-identity race: a concurrent `start()` can replace `_run_id` after the old run finishes but before `_notify_finish()` reads it, so the old callback receives the new run's status and marks the new run as already notified. Capture the completed run's callback, ID, and status while holding the lock, then invoke that captured callback outside the lock.</comment>
<file context>
@@ -690,6 +711,7 @@ def _schedule(self):
self._thread = None
self._stop_handles(handles)
if finished:
+ self._notify_finish()
return
if launch:
</file context>
| def test_every_dashboard_view_module_parses(dashboard): | ||
| """A syntax error in any view module blanks that page, so import them all.""" | ||
| page, *_ = dashboard | ||
| names = sorted(path.stem for path in (ASSETS / "js/views").glob("*.js")) |
There was a problem hiding this comment.
P2: This test does not parse every view module because glob("*.js") excludes nested generator/ and proxy/ views. Enumerate recursively and build each module’s relative slash-separated import path.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At tests/test_dashboard_review_fixes.py, line 110:
<comment>This test does not parse every view module because `glob("*.js")` excludes nested `generator/` and `proxy/` views. Enumerate recursively and build each module’s relative slash-separated import path.</comment>
<file context>
@@ -94,6 +104,36 @@ def mount(page, name):
+def test_every_dashboard_view_module_parses(dashboard):
+ """A syntax error in any view module blanks that page, so import them all."""
+ page, *_ = dashboard
+ names = sorted(path.stem for path in (ASSETS / "js/views").glob("*.js"))
+ assert names
+ assert page.evaluate(
</file context>
| names = sorted(path.stem for path in (ASSETS / "js/views").glob("*.js")) | |
| names = sorted( | |
| path.relative_to(ASSETS / "js/views").with_suffix("").as_posix() | |
| for path in (ASSETS / "js/views").rglob("*.js") | |
| ) |
| - اسکریپت `scripts/install/windows_install.py` (فقط ASCII در مسیرها، بدون `.ps1` غیر ASCII): | ||
| - اگزه را به `%LOCALAPPDATA%\ZcodeGateway\app\ZcodeGateway.exe` کپی میکند. | ||
| - دادهها را به `%LOCALAPPDATA%\ZcodeGateway\data\` منتقل میکند. | ||
| - میانبر دسکتاپ و Start Menu میسازد. |
There was a problem hiding this comment.
P2: windows_install.py does not create the desktop or Start Menu shortcuts claimed here; it only writes a .cmd launcher and README. Add shortcut creation to that script or remove this claim from the proposal.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At PR_PROPOSAL.md, line 43:
<comment>`windows_install.py` does not create the desktop or Start Menu shortcuts claimed here; it only writes a `.cmd` launcher and README. Add shortcut creation to that script or remove this claim from the proposal.</comment>
<file context>
@@ -0,0 +1,241 @@
+- اسکریپت `scripts/install/windows_install.py` (فقط ASCII در مسیرها، بدون `.ps1` غیر ASCII):
+ - اگزه را به `%LOCALAPPDATA%\ZcodeGateway\app\ZcodeGateway.exe` کپی میکند.
+ - دادهها را به `%LOCALAPPDATA%\ZcodeGateway\data\` منتقل میکند.
+ - میانبر دسکتاپ و Start Menu میسازد.
+ - نسخه قبلی portable را شناسایی و با تأیید کاربر migrate میکند (کپی، نه حذف).
+- پرچم `--portable` حفظ میشود تا کسانی که اگزه را کنار خودشان میخواهند، همان رفتار قدیمی را داشته باشند.
</file context>
| img = Image.alpha_composite(img, _glow((width * S, height * S), (width * 0.5, 108), 150 * S, 90)) | ||
| img = Image.alpha_composite(img, _glow((width * S, height * S), (width * 0.85, 300), 110 * S, 40)) |
There was a problem hiding this comment.
P2: These glow centers use logical pixels on a 4x canvas, shifting both glows toward the upper-left instead of placing them at their intended locations. Scale each center coordinate by S before passing it to _glow.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At scripts/installer/make_wizard_images.py, line 121:
<comment>These glow centers use logical pixels on a 4x canvas, shifting both glows toward the upper-left instead of placing them at their intended locations. Scale each center coordinate by `S` before passing it to `_glow`.</comment>
<file context>
@@ -0,0 +1,168 @@
+ gdraw.line([(0, y), (width * S, y)], fill=(255, 255, 255, 7))
+ img = Image.alpha_composite(img, grid)
+
+ img = Image.alpha_composite(img, _glow((width * S, height * S), (width * 0.5, 108), 150 * S, 90))
+ img = Image.alpha_composite(img, _glow((width * S, height * S), (width * 0.85, 300), 110 * S, 40))
+
</file context>
| img = Image.alpha_composite(img, _glow((width * S, height * S), (width * 0.5, 108), 150 * S, 90)) | |
| img = Image.alpha_composite(img, _glow((width * S, height * S), (width * 0.85, 300), 110 * S, 40)) | |
| img = Image.alpha_composite(img, _glow((width * S, height * S), (width * 0.5 * S, 108 * S), 150 * S, 90)) | |
| img = Image.alpha_composite(img, _glow((width * S, height * S), (width * 0.85 * S, 300 * S), 110 * S, 40)) |
| "Data folder: %s\n" | ||
| "Portable mode: %s\n" % (data, portable), |
There was a problem hiding this comment.
P2: In portable mode data remains <target>/data, but the launcher omits ZGW_DATA_DIR and the copied executable writes beside itself in <target>/app; this README names a directory the gateway does not use. Report exe_copy.parent for portable mode and avoid creating the unused data directory.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At scripts/install/windows_install.py, line 113:
<comment>In portable mode `data` remains `<target>/data`, but the launcher omits `ZGW_DATA_DIR` and the copied executable writes beside itself in `<target>/app`; this README names a directory the gateway does not use. Report `exe_copy.parent` for portable mode and avoid creating the unused data directory.</comment>
<file context>
@@ -0,0 +1,142 @@
+ (target / "README.txt").write_text(
+ "ZcodeGateway installed.\n"
+ "Use ZcodeGateway.cmd to start the gateway.\n"
+ "Data folder: %s\n"
+ "Portable mode: %s\n" % (data, portable),
+ encoding="utf-8",
</file context>
| "Data folder: %s\n" | |
| "Portable mode: %s\n" % (data, portable), | |
| "Data folder: %s\n" | |
| "Portable mode: %s\n" % (exe_copy.parent if portable else data, portable), |
| el("span", { class: "spacer" }), | ||
| button({ label: "Copy path", variant: "quiet", | ||
| onClick: () => copyText(folder?.path || "").then(() => toast("Folder path copied", "ok")) }), | ||
| button({ label: "Open folder", variant: "quiet", disabled: !folder?.exists, |
There was a problem hiding this comment.
P2: This button is enabled on Linux whenever the folder exists, but /admin/dash/accounts-folder/open always returns 400 there. Gate it using a server-reported open_folder capability (or an open_supported response field) so unsupported hosts do not offer a guaranteed-failing action.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At zcode_gateway/dashboard/assets/js/views/accounts.js, line 443:
<comment>This button is enabled on Linux whenever the folder exists, but `/admin/dash/accounts-folder/open` always returns 400 there. Gate it using a server-reported `open_folder` capability (or an `open_supported` response field) so unsupported hosts do not offer a guaranteed-failing action.</comment>
<file context>
@@ -418,7 +432,23 @@ function render(root, accounts, pool, reload, signal, actions, campaign = {}, mo
+ el("span", { class: "spacer" }),
+ button({ label: "Copy path", variant: "quiet",
+ onClick: () => copyText(folder?.path || "").then(() => toast("Folder path copied", "ok")) }),
+ button({ label: "Open folder", variant: "quiet", disabled: !folder?.exists,
+ onClick: async () => {
+ try { await api.post("/admin/dash/accounts-folder/open", {});
</file context>
Summary by cubic
3.0.0 build: a real Windows installer, Config Doctor health checks, Safe Mode, automatic HTML reports, and a redesigned dashboard with an Overview landing page.
Highlights
%LOCALAPPDATA%viainstalled.flag, so uninstalling or updating never touches user data.SIGNUP_RATE_LIMITEDresponses and stops new attempts instead of rotating IPs, with a manual toggle.Fixes and notes
NO_PROXYentries made httpx raise InvalidURL.ZGW_DATA_DIRis available for custom data folders.Written for commit cb4c0e1. Summary will update on new commits.